<?php

/**
 * Description of selectBook
 *
 * @author nahuel.lema
 */
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Inicio extends CI_Controller {

    public function index() {
        $this->home();
    }

    function home() {;
        $user = $this->session->all_userdata();
        if (isset($user['logged_in'])) {
            $data['usuario'] = Doctrine::getTable('usuario')->find($user['usuario_id']);
            $data['avatar'] = base_url().'resources/img/uploads/usuarios/'.$data['usuario']->imagen->ruta;
            $data['avatarFb'] = (!!$data['usuario']->idFacebook && $data['usuario']->imagesFacebook)?'https://graph.facebook.com/'.$data['usuario']->idFacebook.'/picture':'';
        }
        $data['content'] = 'secciones/home.php';
        $this->printResults($data);
    }
    
    function printResults($data) {
        $data['header'] = 'header.php';
        $data['footer'] = 'footer.php';

        $this->load->view('index', $data);
    }

}
